﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Con10uum">

  <Style TargetType="{x:Type local:Con10uum}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type local:Con10uum}">
          <Border SnapsToDevicePixels="true"
            Background="{TemplateBinding Background}"
            BorderBrush="{TemplateBinding BorderBrush}"
            BorderThickness="{TemplateBinding BorderThickness}"
            Padding="{TemplateBinding Padding}">
            <ScrollViewer Padding="{TemplateBinding Padding}" Background="{TemplateBinding Background}" Focusable="false" CanContentScroll="True" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Hidden">
              <local:Con10uumPanel x:Name="Con10uumPanel" IsItemsHost="True" Resistance="{TemplateBinding Resistance}" MaxScrollVelocity="{TemplateBinding MaxScrollVelocity}" OpenCloseAnimationDuration="{TemplateBinding OpenCloseAnimationDuration}" WindowMinWidth="{TemplateBinding WindowMinWidth}" WindowMaxWidth="{TemplateBinding WindowMaxWidth}" >
                <local:Con10uumPanel.Resources>
                  <Storyboard x:Key="StoryboardScaleTo1">
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Con10uumPanel" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                      <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1.0">
                        <EasingDoubleKeyFrame.EasingFunction>
                          <CubicEase EasingMode="EaseOut"/>
                        </EasingDoubleKeyFrame.EasingFunction>
                      </EasingDoubleKeyFrame>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Con10uumPanel" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                      <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1.0">
                        <EasingDoubleKeyFrame.EasingFunction>
                          <CubicEase EasingMode="EaseOut"/>
                        </EasingDoubleKeyFrame.EasingFunction>
                      </EasingDoubleKeyFrame>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                  <Storyboard x:Key="StoryboardScaleTo03">
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Con10uumPanel" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                      <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0.3">
                        <EasingDoubleKeyFrame.EasingFunction>
                          <CubicEase EasingMode="EaseOut"/>
                        </EasingDoubleKeyFrame.EasingFunction>
                      </EasingDoubleKeyFrame>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Con10uumPanel" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                      <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0.3">
                        <EasingDoubleKeyFrame.EasingFunction>
                          <CubicEase EasingMode="EaseOut"/>
                        </EasingDoubleKeyFrame.EasingFunction>
                      </EasingDoubleKeyFrame>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </local:Con10uumPanel.Resources>
                <local:Con10uumPanel.RenderTransform>
                  <TransformGroup>
                    <ScaleTransform />
                    <SkewTransform/>
                    <RotateTransform />
                    <TranslateTransform/>
                  </TransformGroup>
                </local:Con10uumPanel.RenderTransform>
              </local:Con10uumPanel>
            </ScrollViewer>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <!--
        CANT SPECIFIE ItemsPanel With Con10uumPanel. Dont understand why... as it work with a WrapPanel
        <Setter Property="ItemsPanel" >
            <Setter.Value>
                <ItemsPanelTemplate>
                    <WrapPanel IsItemsHost="True"/>
                    <local:Con10uumPanel IsItemsHost="True" />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>-->
    <Setter Property="ItemContainerStyle">
      <Setter.Value>
        <Style  TargetType="{x:Type local:Con10uumWindow}">
          <Setter Property="Template">
            <Setter.Value>
              <ControlTemplate TargetType="{x:Type local:Con10uumWindow}">
                <DockPanel x:Name="Con10uumWindowRoot" LastChildFill="True">
                  <ContentControl x:Name="HeaderSite" Content="{TemplateBinding Header}"
                      ContentTemplate="{TemplateBinding local:Con10uum.ItemHeaderTemplate}"
                      ContentTemplateSelector="{TemplateBinding local:Con10uum.ItemHeaderTemplateSelector}"/>
                  <ContentControl x:Name="ContentSite" Content="{TemplateBinding Content}"
                      ContentTemplate="{TemplateBinding local:Con10uum.ItemContentTemplate}"
                      ContentTemplateSelector="{TemplateBinding local:Con10uum.ItemContentTemplateSelector}"/>
                </DockPanel>
              </ControlTemplate>
            </Setter.Value>
          </Setter>
        </Style>
      </Setter.Value>
    </Setter>
  </Style>

  <!--<Style TargetType="{x:Type local:Con10uumWindow}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:Con10uumWindow}">
                    <DockPanel 
                        LastChildFill="True" 
                        Background="{TemplateBinding Background}">
                            <ContentControl x:Name="HeaderSite" Content="{TemplateBinding Header}"  
                                ContentTemplate="{TemplateBinding local:Con10uum.ItemHeaderTemplate}"
                                ContentTemplateSelector="{TemplateBinding local:Con10uum.ItemHeaderTemplateSelector}"/>
                            <ContentControl x:Name="ContentSite" Content="{TemplateBinding Content}"
                                ContentTemplate="{TemplateBinding local:Con10uum.ItemContentTemplate}"
                                ContentTemplateSelector="{TemplateBinding local:Con10uum.ItemContentTemplateSelector}"/>
                    </DockPanel>                                    
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>-->
</ResourceDictionary>
